The present invention relates to clock recovery as may be necessary for example to extract data from a datastream. Where no separate clock is available at the receiver, a clock to sample the data must be generated from the datastream itself.